import java.util.Scanner;

/**
 * @author 52845
 */
public class GoodsLinkNode {
    public int number;//商品编号

    public String name;//商品名称
    public double price;//商品价格

    public String describe;//商品种类


    public String amount;//商品个数

    public String date;//商品生产日期

    public  GoodsLinkNode next;//指向下一个结点的指针
    //构造器
    public GoodsLinkNode() {

    }
    public GoodsLinkNode(int number, String name, double price, String describe, String amount, String date) {
        this.number = number;
        this.name = name;
        this.price=price;
        this.describe=describe;
        this.amount=amount;
        this.date=date;
    }


    public void setInfo()
    {
        Scanner scanner = new Scanner(System.in);
        System.out.print("编号：");
        this.number = scanner.nextInt();
        System.out.print("名称：");
        this.name = scanner.next();
        System.out.print("价格：");
        this.price= scanner.nextDouble();
        System.out.print("分类为：");
        this.amount= scanner.next();
        System.out.print("数量为：");
        this.describe= scanner.next();
        System.out.print("生产日期：");
        this.date= scanner.next();

    }

    //为了显示方法，重写toString方法
    public String toString() {
        return "编号:    " + number+ "    " +
                "名称：" + name + "    " +
                "价格：" + price+
                "分类为：" + describe +
                "数量："  +amount + "    " +
                "生产日期："+date ;
    }
}
